﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:aui="clr-namespace:AzukiMapUI"
	mc:Ignorable="d"
	x:Class="AzukiMapUI.LayerControl"
	d:DesignWidth="640" d:DesignHeight="480" xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data">

    <Grid x:Name="LayoutRoot" Background="White" KeyDown="LayoutRoot_KeyDown">
        <Grid.RowDefinitions>
            <RowDefinition Height="24"/>
            <RowDefinition Height="24"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>

        <!-- header -->
        <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch">
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFE0E0E0"/>
                    <GradientStop Color="#FFA3A3A3" Offset="1"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Image HorizontalAlignment="Left" Margin="4,0,0,0" Width="14" Height="14" Source="./icons/layers.png" Stretch="Fill"/>
        <TextBlock Margin="24,0,0,0" Text="Layer Control" TextWrapping="NoWrap" Foreground="#FF000000" FontFamily="Arial" FontSize="12" VerticalAlignment="Center" FontWeight="Bold"/>

        <!-- layer menu left -->
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#FFF0F0F0" Grid.Row="1">
            <Button x:Name="BtnLayerUp" Click="BtnLayerUp_Click" Margin="2,1,0,1"> 
                <Button.Content>
                    <Image Source="icons/arrow_up.png"  Width="16" Height="16" />
                </Button.Content>
            </Button>
            <Button x:Name="BtnLayerDown" Click="BtnLayerDown_Click" Margin="2,1,0,1">
                <Button.Content>
                    <Image Source="icons/arrow_down.png"  Width="16" Height="16" />
                </Button.Content>
            </Button>
            <Button x:Name="BtnLayerConfig" Click="BtnLayerConfig_Click"  Margin="2,1,0,1">
                <Button.Content>
                    <Image Source="icons/cog.png"  Width="16" Height="16" />
                </Button.Content>
            </Button>
            <!--
			<Image x:Name="ImgUpAllow" MouseLeftButtonUp="ImgUpAllow_MouseLeftButtonDown" Height="16" HorizontalAlignment="Left" Margin="4,4,0,0" VerticalAlignment="Top" Width="16" Source="./icons/bullet_go.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
				<Image.RenderTransform>
					<TransformGroup>
						<RotateTransform Angle="-90"/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Image x:Name="ImgDownAllow" MouseLeftButtonUp="ImgDownAllow_MouseLeftButtonUp"  Height="16" HorizontalAlignment="Left" Margin="4,4,0,0" VerticalAlignment="Top" Width="16" Source="./icons/bullet_go.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
				<Image.RenderTransform>
					<TransformGroup>
						<RotateTransform Angle="90"/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Image x:Name="ImgConfig" Height="16" HorizontalAlignment="Left" Margin="4,4,0,0" VerticalAlignment="Top" Width="16" Source="./icons/cog.png" Stretch="Fill"/>
			-->
        </StackPanel>

        <!-- layer menu right -->
        <StackPanel Orientation="Horizontal" HorizontalAlignment="right" Margin="0,0,0,0" VerticalAlignment="Stretch" Background="#FFF0F0F0" Grid.Row="1">
            <Button x:Name="BtnLayerAdd" Click="BtnLayerAdd_Click"  Margin="0,1,2,1">
                <Button.Content>
                    <Image Source="icons/add.png"  Width="16" Height="16" />
                </Button.Content>
            </Button>
            <!--
            <Button x:Name="BtnLayerDelete" Click="BtnLayerRemove_Click" Margin="0,1,2,1">
                <Button.Content>
                    <Image Source="icons/delete.png"  Width="16" Height="16" />
                </Button.Content>
            </Button>
            -->
            <!--
			<Image x:Name="ImgAddLayer" MouseLeftButtonDown="ImgAddLayer_MouseLeftButtonDown" Height="16" HorizontalAlignment="Left" Margin="4,4,0,0" VerticalAlignment="Top" Width="16" Source="./icons/add.png" Stretch="Fill" MouseLeftButtonUp="OnLayerAddMouseUp"/>
			<Image x:Name="ImgRemoveLayer" MouseLeftButtonDown="ImgRemoveLayer_MouseLeftButtonDown" Height="16" HorizontalAlignment="Left" Margin="4,4,4,0" VerticalAlignment="Top" Width="16" Source="./icons/delete.png" Stretch="Fill"/>
-->
        </StackPanel>

        <!-- list area -->
        <ListBox x:Name="LbLayerList" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="2" SelectionChanged="LbLayerList_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">
                        <CheckBox IsChecked="{Binding IsVisible}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" Content="{Binding Visibility}" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Column="0" d:LayoutOverrides="Width" HorizontalAlignment="Center"/>
                        <Image Height="16" Margin="0,0,0,0" VerticalAlignment="Center" Source="{Binding DataTypeIcon}" Stretch="Fill" Grid.Column="1" HorizontalAlignment="Center" Width="16"/>
                        <TextBox  Margin="0,0,0,0" VerticalAlignment="Center" Text="{Binding Name}" TextWrapping="Wrap" Grid.Column="2" Visibility="Collapsed" HorizontalAlignment="Stretch"/>
                        <TextBlock  Margin="0,0,0,0" VerticalAlignment="Center" Text="{Binding Name}" TextWrapping="Wrap" Grid.Column="2" HorizontalAlignment="Stretch"/>
                    </StackPanel>
                    <!--
                        <Image Height="16" HorizontalAlignment="Right" Margin="0,0,0,0" VerticalAlignment="Center" Width="16" Source="icons/cog.png" Stretch="Fill" Grid.Column="1" x:Name="image"/>
                        -->
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

        <!-- border -->
        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Grid.RowSpan="3" BorderBrush="#FF000000" CornerRadius="5,5,5,5" BorderThickness="0.5,0.5,0.5,0.5"/>

    </Grid>
</UserControl>